package org.leviatan.dataharbour.gui.swingmodels;

import javax.swing.tree.DefaultMutableTreeNode;

import org.leviatan.dataharbour.core.model.PersistenceResource;

public class TreeNodeMdlPersistenceResource extends DefaultMutableTreeNode {

	private static final long serialVersionUID = -919723311247140765L;
	
	private String id;
	
	private String name;
	
	private PersistenceResource theMdl;

	

	
	public TreeNodeMdlPersistenceResource(PersistenceResource persRes) {
		super();
		this.theMdl = persRes;
		this.id = persRes.getId();
		this.name = persRes.getName();
		this.setUserObject(this);
	}

	public String getId() {
		return this.id;
	}

	public String getName() {
		return this.name;
	}

	public void setId(String aId) {
		this.id = aId;
	}

	public void setName(String aName) {
		this.name = aName;
	}
	
	public String toString() {
		return "[Persistence resource]: " + this.name;	
	}

	public PersistenceResource getTheMdl() {
		return theMdl;
	}

	public void setTheMdl(PersistenceResource theMdl) {
		this.theMdl = theMdl;
	}

}
